package online.longzipeng.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import online.longzipeng.entity.User;
import online.longzipeng.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author: lzp
 * @description:
 * @Date: 2023/1/9
 */
@RestController
@RequestMapping("/user")
@Api(tags = "用户相关")
public class UserController {

	@Autowired
	private UserService userService;

	@GetMapping("/get/one")
	@ApiOperation("获取一个用户")
	public User getOne() {
		return userService.getOne(null);
	}

	@GetMapping("/all")
	@ApiOperation("获取一个用户")
	public List<User> all() {
		return userService.list();
	}

}
